
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
    <base href="http://${pageContext.request.serverName }:${pageContext.request.serverPort }${pageContext.request.contextPath }/"/>
    <script  type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="layer/layer.js"></script>
    <script type="text/javascript">


        var array=[2,5,12]

        var arrayStr=JSON.stringify(array)


        var responseBody={
            "stuId":1,
            "stuName":'tom',
            "address":
                {
                    "privince":"广东",
                    "city":"深圳",
                    "stree":"光明"
                },
            "subjectList":[{
                "subjectName":"javaSe",
                "subjectScore":100

            },{
                "subjectName":"ssm",
                "subjectScore":99
            }],
            "map":{
                "k1":"v1",
                "k2":"v2",
            }
        }
        var resStr=JSON.stringify(responseBody)
        $(function () {

            $("#btn3").click(function () {
                layer.msg("slhsssd")
            });

            $("#btn2").click(function () {
                $.ajax({
                    "url":"sendComposeObject.html",
                    type:"post",
                    data:resStr,
                    "contentType":"application/json;charset=UTF-8",//设置请求体内容的类型
                    "success":function (response) {
                        alert(response)

                    },
                    "error":function (response) {


                    }
                });


            });

            $("#btn1").click(function () {
                $.ajax({
                    "url":"send/array.html",//请求目标资源地址
                    "type":"post",  //请求方式
                    "data":arrayStr,  //发送的请求参数

                    dataType:"text",
                    "contentType":"application/json;charset=UTF-8",//设置请求体内容的类型
                    "success":function (response) {
                        alert(response)

                    },
                    "error":function (response) {


                    }
                })

            });

        });
    </script>
</head>
<body>
<a href="${pageContext.request.contextPath}/admin/login.html">测试ssm</a>
<br/>
<button id="btn1">test_ajax1</button>

<br/>
<button id="btn2">test_ajaxObject2</button>

<br/>
<button id="btn3">layer</button>
</body>
</html>
